﻿<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="~/css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./css/aui.css" />
    <style type="text/css">
        .header {
            padding: 2.5rem 0.5rem 2rem 0.5rem;
        }
    </style>
</head>
<body>
    <header class="aui-bar aui-bar-nav aui-text-left header" id="header">
        <br />
        <h1>
            <a class="aui-btn aui-pull-right" tapmode onclick="openClub()">
                <i class="aui-iconfont aui-icon-mobile"></i>
            </a>
            预约详情
        </h1>
    </header>
    <div class="aui-content aui-margin-b-15">
        <ul class="aui-list aui-form-list">
            <li class="aui-list-header">该预约信息如下</li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">

                    <div class="aui-list-item-label">
                        <i class="aui-iconfont aui-icon-my"></i>&nbsp;&nbsp;医师姓名
                    </div>
                    <div class="aui-list-item-label">    @ViewData["doctorname"]</div>


                </div>
            </li>

            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">
                        <i class="aui-iconfont aui-icon-map"></i>&nbsp;&nbsp;科室信息
                    </div>
                    <div class="aui-list-item-label">
                        @ViewData["classname"] <p>@ViewData["classplace"]</p>
                    </div>
                </div>
            </li>

            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">
                        <i class="aui-iconfont aui-icon-calendar"></i>&nbsp;&nbsp;预约时间
                    </div>
                    <div class="aui-list-item-label">
                        @ViewData["date"]&nbsp;&nbsp;&nbsp;&nbsp;

                        @switch (ViewData["time"].ToString())
                        {
                            case "1":
                                @:上午 &nbsp;&nbsp;8：00-9：00
                                break;
                            case "2":
                                @:上午&nbsp;&nbsp;9：00-10：00
                                break;
                            case "3":
                                @:上午&nbsp;&nbsp;10：00-11：00
                                break;
                            case "4":
                                @:上午&nbsp;&nbsp;11：00-12：00
                                break;
                            case "5":
                                @:下午&nbsp;&nbsp;2：00-3：00
                                break;
                            case "6":
                                @:上午&nbsp;&nbsp;3：00-4：00
                                break;
                            case "7":
                                @:下午&nbsp;&nbsp;4：00-5：00
                                break;
                        }
                    </div>
                </div>
            </li>

            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">
                        <i class="aui-iconfont aui-icon-my"></i>&nbsp;&nbsp;患者信息
                    </div>
                    <div class="aui-list-item-label">
                        @ViewData["username"] &nbsp; @ViewData["userage"] 岁
                    </div>
                </div>
            </li>
            @if (ViewData["status"].ToString()=="2")
            {

                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            <i class="aui-iconfont aui-icon-my"></i>&nbsp;&nbsp;医嘱：&nbsp;@ViewData["tell"]
                        </div>
                    </div>
                </li>
            }
        </ul>

        @if (ViewData["status"].ToString() == "0")
        {
            if (ViewData["invalid"].ToString() == "1")
            {
                <div class="aui-content-padded" tapmode onclick="openDialog('invalid')">
                    <secton class="aui-grid">
                        <p><div class="aui-btn aui-btn-default aui-btn-block"><font color="#FFFFFF"><span class="aui-iconfont aui-icon-info"></span>该预约不可取消点击查看帮助</font></div></p>
                    </secton>
                </div>
            }
            else
            {
                <a href="/Vip/MyUpdate?id=@ViewData["id"]&doctorname=@ViewData["doctorname"]&createtime=@ViewData["createtime"]&username=@ViewData["username"]&userage=@ViewData["userage"]">
                    <div class="aui-content-padded">
                        <p><div class="aui-btn aui-btn-primary aui-btn-block " tapmode onclick="showDefault('loading')"><font color="#FFFFFF">修改预约时间</font></div></p>
                    </div>
                </a>
            }
            <div class="aui-content-padded" tapmode onclick="openDialog('text')">
                <p><div class="aui-btn aui-btn-info aui-btn-block"><font color="#FFFFFF">取消这个预约</font></div></p>
            </div>
        }
        else if (ViewData["invalid"].ToString() == "4")
        {
            <div class="aui-content-padded">
                <div class="aui-btn aui-btn-default aui-btn-block"><font color="#FFFFFF">不可更改为了方便测试临时可以取消</font></div>
            </div>
        }
        else if (ViewData["invalid"].ToString() == "2")
        {
            <div class="aui-content-padded">
                <div class="aui-btn aui-btn-default aui-btn-block"><font color="#FFFFFF">此预约已成功取号</font></div>
            </div>
        }
    </div>
</body>
</html>
<script type="text/javascript" src="~/script/aui-dialog.js"></script>
<script type="text/javascript" src="~/script/aui-toast.js"></script>
<script type="text/javascript">
    var dialog = new auiDialog({})
    var toast = new auiToast();
     function openDialog(type) {
        switch (type) {
            case "text":
                dialog.alert({
                    title: "取消预约",
                    msg: '确定要取消此预约吗<p>（行为可能将会被记录）</p>',
                    buttons: ['取消', '确定']
                }, function (ret) {
                    if (ret.buttonIndex == 2) {
                        toast.success({
                            title: "取消成功",
                            duration: 2000
                        });
                        window.location.href = "/Vip/MyCancel?createtime=@ViewData["createtime"]";
                    }
                    console.log(ret)
                })
                break;

            case "invalid":
                dialog.alert({
                    title: "帮助",
                    msg: '对于距预约就诊日期小于一日的预约<p>请到医院取号就诊或取消预约</p>',
                    buttons: ['取消', '确定']
                }, function (ret) {
                    console.log(ret)
                })
                break;

            case "input":
                dialog.prompt({
                    title: "弹出提示",
                    text: '默认内容',
                    buttons: ['取消', '确定']
                }, function (ret) {
                    if (ret.buttonIndex == 2) {
                        dialog.alert({
                            title: "提示",
                            msg: "您输入的内容是：" + ret.text,
                            buttons: ['确定']
                        });
                    }
                })
                break;
            default:
                break;

        }
         
    function showDefault(type) {
        switch (type) {
            case "success":
                toast.success({
                    title: "提交成功",
                    duration: 2000
                });
                break;
            case "fail":
                toast.fail({
                    title: "提交失败",
                    duration: 2000
                });
                break;
            case "custom":
                toast.custom({
                    title: "提交成功",
                    html: '<i class="aui-iconfont aui-icon-laud"></i>',
                    duration: 2000
                });
                break;
            case "loading":
                toast.loading({
                    title: "加载中",
                    duration: 2000
                }, function (ret) {
                    console.log(ret);
                    setTimeout(function () {
                        toast.hide();
                    }, 3000)
                });
                break;
            default:
                // statements_def
                break;
        }
    }
    }
</script>
<script type="text/javascript" src="~/script/api.js"></script>
<script type="text/javascript">
    apiready = function () {
        api.setStatusBarStyle({
            style: 'light'
        });
        api.parseTapmode();
        var header = $api.byId('header');
        var headerPos = $api.offset(header);
        var body_h = $api.offset($api.dom('body')).h;
        var header_h = $api.offset($api.byId('header')).h;
        api.openFrame({
            name: 'index_frm',
            url: './html/index_frm.html',
            bounces: true,
            rect: {
                x: 0,
                y: header_h,
                w: 'auto',
                h: 'auto'
            }
        })
    };
    function openClub() {
        var delay = 0;
        if (api.systemType != 'ios') {
            delay = 300;
        }
        api.openWin({
            name: 'club_win',
            url: './html/club_win.html',
            bounces: false,
            delay: delay,
            slidBackEnabled: true,
            vScrollBarEnabled: false,
            progress: {
                type: "page"
            }
        });
    }
    function closeWin() {
        api.closeWin({
        });
    }
</script>